package cn.liccshop.core.service.shopCategory.service;

import cn.liccshop.core.entity.ShopAttribute;
import cn.liccshop.core.entity.ShopCategory;
import cn.liccshop.sys.exception.MySystemException;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品分类表（就是页面导航栏） 服务类
 * </p>
 *
 * @author LiCC
 * @since 2019-04-08
 */
public interface IShopCategoryService extends IService<ShopCategory> {
    /**
     * 添加分类， 并赋值前端树ID
     * @param shopCategory
     * @return
     */
    ShopCategory saveShopCategory(ShopCategory shopCategory, List<ShopAttribute> shopAttributes);

    /**
     * 更新分类
     * @param shopCategory
     * @param shopAttributes
     * @return
     */
    ShopCategory updateShopCategory(ShopCategory shopCategory, List<ShopAttribute> shopAttributes) throws MySystemException;

    /**
     * 获取分类信息
     * @param shopCategory
     * @return
     */
    List<ShopCategory> shopCategoryInfos(ShopCategory shopCategory) throws MySystemException;

    /**
     * 删除分类
     * @param shopCategory
     * @return
     */
    String deleteShopCategory(ShopCategory shopCategory) throws MySystemException;

    Map<String, JSONObject> checkCategoryByCategoryId(String catId);
}
